package com.shi.shiro.common;

import cn.hutool.json.JSONUtil;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Response {

    public static void write(HttpServletResponse response,Result result){
        response.setContentType("application/json;charset=utf8");
        try {
            response.getWriter().write(JSONUtil.toJsonStr(result));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
